﻿Imports MyPOSLibrary
Imports System.Data
Imports MyPOSDataLayer

Public Class SearchWindow
    Public Property ConnectionString As String
    Private Sub CommandBinding_Executed(ByVal sender As System.Object, ByVal e As System.Windows.Input.ExecutedRoutedEventArgs)
        MessageBox.Show(
            String.Format("Command: {0}\nParameter: {1}\nSource: {2}\nOriginal Source: {3}",
                   e.Command, e.Parameter, e.Source, e.OriginalSource),
            e.RoutedEvent.Name)
        e.Handled = True
    End Sub

    Public Property FormType As FormsList = FormsList.None
    Dim DataCollection As Object

    Private Sub SearchWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded

        If FormType = FormsList.ClientList Then
            Dim DataObject As New MasterDataLayer(ConnectionString)
            DataCollection = DataObject.GetClientList
        End If

        SearchDataGrid.ItemsSource = DataCollection
    End Sub

    Private Sub MainWindow_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseDown
        DragMove()
    End Sub

    Private Sub CloseButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles CloseButton.Click
        Me.Close()
    End Sub
End Class
